load("@prelude//cxx/dist_lto:tools.bzl", "dist_lto_tools")
load("@prelude//utils:source_listing.bzl", "source_listing")

oncall("build_infra")

source_listing()

prelude = native

prelude.python_bootstrap_binary(
    name = "dist_lto_planner_gnu",
    main = "dist_lto_planner_gnu.py",
    visibility = ["PUBLIC"],
)

prelude.python_bootstrap_binary(
    name = "dist_lto_planner_darwin",
    main = "dist_lto_planner_darwin.py",
    visibility = ["PUBLIC"],
)

prelude.python_bootstrap_binary(
    name = "dist_lto_opt_gnu",
    main = "dist_lto_opt_gnu.py",
    visibility = ["PUBLIC"],
)

prelude.python_bootstrap_binary(
    name = "dist_lto_opt_darwin",
    main = "dist_lto_opt_darwin.py",
    visibility = ["PUBLIC"],
)

prelude.python_bootstrap_binary(
    name = "dist_lto_prepare_gnu",
    main = "dist_lto_prepare_gnu.py",
    visibility = ["PUBLIC"],
)

prelude.python_bootstrap_binary(
    name = "dist_lto_prepare_darwin",
    main = "dist_lto_prepare_darwin.py",
    visibility = ["PUBLIC"],
)

prelude.python_bootstrap_binary(
    name = "dist_lto_copy",
    main = "dist_lto_copy.py",
    visibility = ["PUBLIC"],
)

prelude.python_bootstrap_binary(
    name = "dist_lto_archive_mapper",
    main = "dist_lto_archive_mapper.py",
    visibility = ["PUBLIC"],
)

prelude.python_bootstrap_binary(
    name = "dist_lto_compiler_stats_merger",
    main = "dist_lto_compiler_stats_merger.py",
    visibility = ["PUBLIC"],
)

dist_lto_tools(
    name = "dist_lto_tools",
    visibility = ["PUBLIC"],
)

prelude.python_test(
    name = "test_dist_lto_opt",
    srcs = [
        "dist_lto_opt_gnu.py",
        "tests/test_dist_lto_opt.py",
    ],
)
